package cn.edu.abtu.controller;

import cn.edu.abtu.entity.CrmBanner;
import cn.edu.abtu.service.CrmBannerService;
import cn.edu.abtu.vo.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/educms/banneradmin")
public class CrmBannerAdminController {

    @Autowired
    private CrmBannerService crmBannerService;

    @PostMapping("/add")
    public ResponseData addBanner(@RequestBody CrmBanner crmBanner){
        return crmBannerService.addBanner(crmBanner);
    }

    @DeleteMapping("/delete/{bannerId}")
    public ResponseData deleteBanner(@PathVariable String bannerId){
        return crmBannerService.deleteBanner(bannerId);
    }

    @GetMapping("/list")
    public ResponseData listBanner(){
        return crmBannerService.listBanner();
    }


}
